package com.springcloud.demo.test.design.strategy.calculation;

import com.springcloud.demo.test.design.strategy.calculate;

/**
 * @author zhouyang
 * @Description
 * @date 2018/09/10
 */
public class Discount implements calculate {

    private double rate = 1;

    public Discount() {
    }

    public Discount(double rate) {
        this.rate = rate;
    }

    @Override
    public double cal(double original) {
        return original * rate;
    }

    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }
}
